Some existing web services systems use a publish-subscribe model for handling events in a system. A typical system includes a message distributor, message subscribers and a middleware.
Data of messages are transmitted between the message distributor and the message subscribers via the middleware. The message distributor may distribute various types of messages relating to a variety of topics. The message subscribers may subscribe for the messages of interest. The middleware may transmit the messages of a topic distributed by the message distributor to the message subscribers that have subscribed for a particular message topic. Messages of the same topic may be subscribed by multiple different message subscribers. Different message subscribers may process the received messages differently. For example, two message subscribers, Subscriber A and Subscriber B, subscribe to the same topic, e.g. Topic A, each of the two message subscribers may process the received messages of Topic A in its own manner.
For example, during an electronic transaction, when the transaction is created successfully, a message distributor such as a transaction handling system may send a notification message notifying the success of the transaction. A message subscriber such as a transaction log server may subscribe for the notification message so as to record transaction logs, and another message subscriber such as a seller notification server may also subscribe for the notification message so as to notify the seller that a product has been sold. That is, the two servers may process the same message differently.
In some application scenarios, more than one subscriber in the service systems may subscribe for messages of the same topic. In such cases, a middleware is used to transmit the messages of the same topic to the more than one subscriber. In a typical system, each message subscriber is formed by a single node, which means that only one device can be used to provide services. As the amount of data to be processed increases, such typical systems often no longer meet the requirements of the large amount of data for several reasons.
First, when a message subscriber node fails, the message subscriber may be unable to receive the subscribed messages from the middleware or may be unable to process the subscribed messages even if the messages are received. In such cases, message processing of the message subscriber is interrupted, thereby adversely affecting the processing of other systems associated with the message subscriber.
Second, a single node may be incapable of processing large message traffic. Therefore, when the amount of messages is too large for a single node, hardware upgrade may be needed to accommodate a large amount of data.